package register

import (
	"fmt"
)

const AndroidEnvLogTag = "AndroidEnvBase"

type AndroidEnvBase struct {
	Env
	// app签名
	SIGNATURE string
	// whatsapp logo.png 和 内置秘钥 计算
	KEY string
	// dex Md5
	MD5CLASSES string
	// whatsapp 版本号
	VERSION string
	// 设备类型
	OSNAME string
	// 设备版本
	OSVERSION string
	// 制造商
	MANUFACTURER string
	// 设备名
	DEVICENAME string

	BUILDVERSION string
}

func (a *AndroidEnvBase) GetToken(phone string) string {
	token, err := androidCalcWAToken(phone, a.KEY, a.MD5CLASSES, a.SIGNATURE)
	if err != nil {
		return ""
	}
	return token
}

func (a *AndroidEnvBase) WAUserAgent() string {
	//WhatsApp/2.21.15.16 Android/11 Device/Google-Pixel_4a_(5G)
	//WhatsApp/2.21.14.24 SMBA/11 Device/Google-Pixel_4a_(5G) //商业版
	//https://y9yrsygcg6.execute-api.us-east-1.amazonaws.com/s/s?_=/v2/code&ENC=qosq4TSuu2HdAYSthIVgRwIHQY-2r0MlvMVEgoW28RHORqVWCtkeFeGrpPvXoInctp6TX_AMb4ryGdFN2BEjVuXvBkMqqd-nyEGSxGXVXLjMhjNRytd1dp5DWPgcLOQ9bN545w_a_alAE7AqFmp0cwKItomHqVDE4wsfpcmALQp0uUfP4SPVgwVjxXqNCuWCV9exQQqisOB0gycByec9u6UBqyiplAAsBuyFVnwqt7T9W0La7Oy_CdOl6yER07ZN3KIylhxqQGj-vTO2RfkfdN1kuZ8Fi8G6DEFd1x6YLGTCf5Lx_9ryT4U4iACLxvlKUMlGWXLv4xEFHP5XZNx56YAJGN1Do-07zDgd2I-uAMMjVV_Thq702Srt4y8ctdxQQbU_jJHevpdUXbVzYou8zrE00aSFyMk8xXP9u3fSgE7BArSbBO1VAYr06YOWuk4V-jmWbPHj7kfpNHV7clElnQ0G34oDu09nLIaDN8N5oqM7sZL9IsEynf99WMsYZzwmJzzD1OPSzF-KwMue6yQ0fkoNt0ER1AQp9xYJX1BEWjOunc2uk3Ly2eljT78Srlx9OgffgJT97Nzdnoq0HPleuJIIf8EUl6MzqpqS5nr-lfW3ba3_fswFbv3nhS77J8jWwdPRWoODo4EBFNug4oHSUsjPvTRz-ooFflsETEKzquYf5jFVTwZNkXutuMlArYQSXXDIaZ_oOxYd0c_EV-CUxPShnircVz9U-_e1E-o3WVsb5Pywud3lXidhsiBlkYLx09sogG3ubaot6-0vrnPMYiBpXRnDk3QI2_a0OlT-U7A477_WYDdD53fZpAUr7-z1AtE9o6FnuNn0BMiCfvoEvA6-gdAOB__h35OKoSy046aI0LX-3xcMCsM%3D
	return fmt.Sprintf("WhatsApp/%s %s/%s Device/%s-%s", a.VERSION, a.OSNAME, a.OSVERSION, a.MANUFACTURER, a.DEVICENAME)
}
